package cn.tedu.ivos.vehicle.pojo.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
public class VehicleAddParam {

    /**
     * 车辆ID，主键
     */
    @Schema(description = "车辆id")
    private Long id;

    /**
     * 车辆品牌
     */
    @Schema(description = "车辆品牌")
    @NotBlank(message = "车辆品牌不能为空")
    private String brand;

    /**
     * 车牌号
     */
    @Schema(description = "车牌号")
    @NotBlank(message = "车牌号不能为空")
    @Pattern(regexp = "^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵青藏川宁琼使领][A-Z][A-Z0-9DF][A-Z0-9]{4}$",
            message = "车牌号格式不正确")
    private String license;

    /**
     * 车辆型号
     */
    @Schema(description = "车辆型号")
    @NotBlank(message = "车辆型号不能为空")
    private String model;

    /**
     * 车辆识别码
     */
    @Schema(description = "车辆识别码")
    @NotBlank(message = "车辆识别码不能为空")
    @Size(min = 6,max = 6,message = "车辆识别码长度为6")
    private String code;

    /**
     * 车辆排量
     */
    @Schema(description = "车辆排量")
    @NotBlank(message = "车辆排量不能为空")
    private String displacement;

    /**
     * 车辆类型
     */
    @Schema(description = "车辆类型")
    @NotBlank(message = "车辆类型不能为空")
    private String type;

    /**
     * 车辆颜色
     */
    @Schema(description = "车辆颜色")
    @NotBlank(message = "车辆颜色不能为空")
    private String color;

    /**
     * 里程数（单位：公里）
     */
    @Schema(description = "里程数")
    @NotBlank(message = "里程数不能为空")
    private String kilometers;

    /**
     * 上牌时间
     */
    @Schema(description = "上牌时间")
    @NotNull(message = "上牌时间不能为空")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date regTime;

    /**
     * 购买时间
     */
    @Schema(description = "购买时间")
    @NotNull(message = "购买时间不能为空")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date buyTime;

    /**
     * 购买价格（单位：元）
     */
    @Schema(description = "购买价格")
    @NotBlank(message = "购买价格不能为空")
    private String price;

    /**
     * 电池类型
     */
    @Schema(description = "电池类型")
    @NotBlank(message = "电池类型不能为空")
    private String batteryType;

    /**
     * 电子围栏绑定状态：已绑定1 未绑定0
     */
    @Schema(description = "电子围栏绑定状态：已绑定1 未绑定0")
    private String geofenceBindStatus;

    /**
     * 电子围栏ID
     */
    @Schema(description = "电子围栏id")
    private Long geofenceId;
}
